All Questions
Tagged with bash-arrayassociative-array
2 questions
0votes
0answers
218views
Unexpected behavior during index assignment in a Bash array [duplicate]
I'm having trouble assigning values to a specific bash index, but apparently only when the index variable is set using a while read loop. Taking this code as a test example: #!/bin/bash read -d '' ...
1vote
2answers
2kviews
Merge duplicate keys in associative array BASH
I've got an array that contains duplicate items, e.g. THE_LIST=( "'item1' 'data1 data2'" "'item1' 'data2 data3'" "'item2' 'data4'" ) Based on the above, I want to create an associative array that ...